/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.fzhucc.modules.sciEnterprise.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author yyg
* @date 2024-06-03
**/
@Entity
@Data
@Table(name="tb_sci_enterprise")
public class SciEnterprise implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`is_edit`",nullable = false)
    @ApiModelProperty(value = "是否允许编辑默认否")
    private Integer isEdit;

    @Column(name = "`name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "企业名称")
    private String name;

    @Column(name = "`code`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "统一社会信用码")
    private String code;

    @Column(name = "`org_area`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "地区组织机构区分  ")
    private String orgArea;

    @Column(name = "`details`")
    @ApiModelProperty(value = "企业简介")
    private String details;

    @Column(name = "`is_zxw`")
    @ApiModelProperty(value = "是否为中小微企业")
    private String isZxw;

    @Column(name = "`is_zj`")
    @ApiModelProperty(value = "是否为专精特新企业")
    private String isZj;

    @Column(name = "`is_delete`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "是否删除默认否")
    private Integer isDelete;

    @Column(name = "`a_status`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "审核状态  字典qy_audit_status")
    private String aStatus;

    @Column(name = "`nature`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "企业性质  字典craftsman_enterprise_property")
    private String nature;

    @Column(name = "`company_area`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "企业所在区域  ")
    private String companyArea;

    @Column(name = "`legal_representative`")
    @ApiModelProperty(value = "法定代表人")
    private String legalRepresentative;

    @Column(name = "`detail_address`")
    @ApiModelProperty(value = "企业详细地址")
    private String detailAddress;

    @Column(name = "`established_time`")
    @ApiModelProperty(value = "企业成立时间（格式yyyy-MM-dd）")
    private String establishedTime;

    public void copy(SciEnterprise source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
